package com.liaoxuefeng.ref_exe;

public class Pair {
    private String first;
    private String last;

    public Pair(String first, String last) {
        this.first = first;
        this.last = last;
    }

    public String getFirst() {
        return first;
    }

    public String getLast() {
        return last;
    }
}

/**
 * 泛型
 *
 *  静态方法不能引用泛型<T>, 必须定义其他类型来实现静态泛型方法.
 *  可以定义多种泛型, 例如Map(K, V);
 * @param <T>
 */
class PairString<T> {
    private T first;
    private T last;

    public PairString(T first, T last) {
        this.first = first;
        this.last = last;
    }

    public T getFirst() {
        return first;
    }

    public T getLast() {
        return last;
    }
}